#### II Replication ####
### purpose: replicating figure 2 ####
# installing packages ----

list.of.packages = c('ggplot2')
new.packages <- list.of.packages[!(list.of.packages %in% 
                                     installed.packages()[,"Package"])]

if(length(new.packages)) install.packages(new.packages)

# loading packages ----

suppressPackageStartupMessages(
  {
    library(ggplot2)
  }
)

# loading in data ----
usaid_staff <- readRDS("~/data/fig_data_usaid_staff.RDS")

f2 <- 
  ggplot(usaid_staff, aes(as.integer(year),employees, group=1))+
  geom_line() +
  ylab("the number of employees of USAID") +
  xlab("year")+
  scale_x_continuous(breaks=seq(1965,2020,5)) +
  theme_minimal() +
  labs(caption = "Source: Essex (2013), FedScope")


ggsave(plot = f2, 
       filename = "~figures/figure2_usaidstaff.jpeg",
       width = 8, height = 5, dpi = 1200)
